#include "ExceptionConstructor.h"


CExceptionAlpha::CExceptionAlpha(int age) throw(std::invalid_argument)
{
    if (age < 0 || age > 200)
        throw std::invalid_argument("Alpha invalid argument");
    m_Age = age;
    printf("CExceptionAlpha construct!\n");
}


CExceptionAlpha::~CExceptionAlpha() throw(std::invalid_argument)
{
	printf("%d \n", m_Age);
    throw std::invalid_argument("Alpha destruct invalid argument");
    printf("CExceptionAlpha desconstruct!\n");
}

CExceptionBeta::CExceptionBeta(int height) throw(std::invalid_argument)
{
    if (height < 5 || height > 500)
        throw std::invalid_argument("Beta invalid argument");
    m_Height = height;
    printf("CExceptionBeta construct!\n");
}


CExceptionBeta::~CExceptionBeta()
{
    printf("CExceptionBeta desconstruct!\n");
}

CExceptionGroup::CExceptionGroup(int count) throw(std::invalid_argument) :
    m_Alpha(10), m_Beta(20)
{
    if (count < 0 || count > 500)
        throw std::invalid_argument("Group invalid argument");
    m_Count = count;
    printf("CExceptionGroup construct!\n");
}


CExceptionGroup::~CExceptionGroup()
{
    printf("CExceptionGroup desconstruct!\n");
}
